#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <vector>
using namespace std;

class Solution {
public:

    int getLongestPalindrome(string A) {
        int max = 0;
        int len = A.size();
        for (int i = 0; i < len; i++)
        {
            int sum = 1;
            int left = i - 1, right = i + 1;
            while (left >= 0 && right < len && A[left] == A[right])
            {
                sum += 2;
                left--;
                right++;
            }
            if (sum > max) max = sum;

            sum = 1;
            left = i - 1, right = i + 1;
            if (i != 0 && A[i - 1] == A[i])
            {
                left -= 1;
                sum += 1;
            }
            while (left >= 0 && right < len && A[left] == A[right])
            {
                sum += 2;
                left--;
                right++;
            }
            if (sum > max) max = sum;
        }
        return max;
    }
};

int main() {
    return 0;
}
